package com.cloud.system.project.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.cloud.common.core.annotation.Excel;
import com.cloud.common.core.model.supers.Convert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author Sam
 * @since 2020-12-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_user")
@ApiModel(value = "User对象", description = "系统用户表")
public class User extends Convert {

    private static final long serialVersionUID = 1L;

    @Excel(name = "用户序号", prompt = "用户编号")
    @ApiModelProperty(value = "用户id")
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    @Excel(name = "部门编号", type = Excel.Type.IMPORT)
    @ApiModelProperty(value = "部门id")
    private String deptId;

    @Excel(name = "角色编号", type = Excel.Type.IMPORT)
    @ApiModelProperty(value = "角色id")
    private String roleId;

    @Excel(name = "用户名")
    @ApiModelProperty(value = "用户名")
    private String userName;

    @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
    @ApiModelProperty(value = "性别 0男 1女")
    private Integer sex;

    @Excel(name = "手机")
    @ApiModelProperty(value = "手机")
    private String phone;

    @Excel(name = "邮箱")
    @ApiModelProperty(value = "邮箱")
    private String email;

    @Excel(name = "登陆名")
    @ApiModelProperty(value = "登陆名")
    private String loginName;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "级别 0 普通 1超级用户")
    private Integer level;

    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    @ApiModelProperty(value = "状态 0：正常 1：禁用")
    private Integer status;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;


}
